#include "base/Simulator.h"
#include "base/simapi.h"
#include "base/threads/SimulatedState.h"
#include "base/threads/ThreadManager.h"
#include "util/Logger.h"

#include "CPU.h"

SimulatedState::SimulatedState () :
  cpu(0),
  thread_id(0)
{}

void SimulatedState::capture() {
    ASSERT(inSimulation);
    // simulator code, so cannot use Sim_GetMyId()
    cpu = curPE->getID();

    Reg tid;
    ThreadManager::isa_ext_threadid(curPE->P, (Reg)0, (Reg)0, &tid);
    thread_id = (int)tid;
}
